Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

214
Visualizações
PhotoSwipe | create Title Element | Responsive

i want to add an Title Element below my Image Gallery created with PhotoSwipe. But my Title Element sticks not under the Image. It sticks to fast in the Image when Browser rescaling vertically.

JS to create the Element:

            lightbox.pswp.ui.registerElement({
                name: 'werkInformationen',
                className: 'smallWerkInformationen',
                appendTo: 'wrapper',
                onInit: (el, pswp) => {
                    var wrapDiv = document.createElement('div');
                    wrapDiv.className = 'wrapDiv';

                    var popUp = document.createElement('div');
                    popUp.className = 'popUpWerkInformationenTitle';
                    popUp.id = 'popUpWerkInformationenTitle';

                    var span = document.createElement('span');
                    span.className = 'child';
                    span.id = 'popUpWerkInformationenTitleSpan';
                    
                    wrapDiv.appendChild(popUp);
                    popUp.appendChild(span);

                    el.appendChild(wrapDiv);

                    pswp.on('change', (a,) => {
                        var paramsFromCurrentWerk = new URLSearchParams(lightbox.pswp.currSlide["data"]["src"]);
                        document.getElementById("popUpWerkInformationenTitleSpan").innerHTML = paramsFromCurrentWerk.get('id') + " | " + paramsFromCurrentWerk.get('werkName') + " | " + paramsFromCurrentWerk.get('material') + " | " + paramsFromCurrentWerk.get('kuenstler');
                    });
                }
            });

Output to HTML:

<div class="smallWerkInformationen pswp__hide-on-close">
    <div class="wrapDiv">
        <div class="popUpWerkInformationenTitle">
            <span class="child">PLACEHOLDER TEXT</span>
        </div>
    </div>
</div>

CSS:

.wrapDiv {
    min-width: 600px;
}

.smallWerkInformationen {
    position: relative;
}

#popUpWerkInformationenTitle {
    font-size: 12px;
    position: fixed;
    bottom: 0;
    width: 100%;
    text-align: center;
    margin-bottom: 30px;
}

#popUpWerkInformationenTitleSpan {
    text-align: center;
    background-color: black;
    color: #fff;
    border-radius: 5px;
    margin-left: 15px;
    margin-right: 15px;
    margin-top: 15px;
    font-size: 1rem !important;
    padding: 5px;
}

Expected Result until there is no space: Expected Result until there is no space

My Result:
There is enough Space to fit the Text Element below but it goes in the Image.

My Result

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

There is already an Caption example. But not that exactly what i want.

https://photoswipe.com/caption/

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda